Hotfix/machine id header - #78
Conversation
…ions Ports the March feature/machine-id-header work onto current master: native machine_id_reader for the shared OpenFrame machine_id file, x-machine-id on the control WebSocket connect, and machine-id + JWT headers on core/recovery-core HTTP(S) requests in openFrameMode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
make clean skipped openframe/*.o, so the ARCHID=10005 universal build linked stale first-arch objects and failed on _extract_token / _read_machine_id for the second arch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change adds cross-platform OpenFrame machine-ID reading and conditionally sends ChangesOpenFrame request identity
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.6)CoreModule.jsFile contains syntax errors that prevent linting: Line 612: the target for a delete operator cannot be a single identifier; Line 1396: the target for a delete operator cannot be a single identifier; Line 3188: the target for a delete operator cannot be a single identifier Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CoreModule.js`:
- Around line 739-755: Restrict OpenFrame credentials to approved server
authorities over TLS: update addOpenFrameHeaders to validate the destination
authority and require https: or wss: before attaching x-machine-id or
Authorization. Apply the same guard at CoreModule.js lines 5139-5140, 5168-5169,
and 5818-5819, modules/RecoveryCore.js lines 25-41, and meshcore/agentcore.c
lines 4758-4781; reject or omit credentials for untrusted authorities and
insecure ws:/http: targets.
In `@openframe/machine_id_reader.c`:
- Around line 32-36: Update both machine-ID reading paths in
openframe/machine_id_reader.c at lines 32-36 and 75-79 to reject overlong lines
or continue reading until the complete line is consumed; never return a
truncated machine ID. Apply identical handling in both sites, preserving the
existing cleanup and failure behavior when rejecting invalid input.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2b841b21-bf5f-4179-b1a0-ff3b4f05f7df
📒 Files selected for processing (8)
CoreModule.jsmakefilemeshconsole/MeshConsole-2022.vcxprojmeshcore/agentcore.cmeshservice/MeshService-2022.vcxprojmodules/RecoveryCore.jsopenframe/machine_id_reader.copenframe/machine_id_reader.h
addOpenFrameHeaders() creates options.headers, but the duktape http client only auto-adds Host when no headers object exists (ILibDuktape_HttpStream.c). So every openFrameMode relay/tunnel and download dial went out with no Host; the gateway load balancer rejects the host-less upgrade, so remote sessions spin "connecting" forever even though the device shows online (the native control channel builds its own Host). Set Host in addOpenFrameHeaders, mirroring the native host[:port] rule (drop the port for 443/TLS or 80/plain). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Description
Improvements
Task
Link
Summary by CodeRabbit
New Features
openFrameModestatus property to indicate when OpenFrame support is active.Reliability